#!/bin/sh

cd ~/workshop/rubish

# t_today 格式：6月2日

if [ $# -eq 0 ]; then 
	t_date=`da +0`
	t_date_1=`daa +0`
else

	t_date=`da $1`
	t_date_1=`daa $1`
fi

t_today=`echo $t_date |sed -e "s/.*年//"`

t_date_1=`echo $t_date_1 | sed -e "s/.*年//"`

echo $t_today

echo $t_date_1

# 用subl打开今天需要阅读的文章
yumo

find ~/workshop/gitee/3place |grep md | grep -E "$t_today|$t_date_1" |sed "/年/d" >/tmp/ot
find ~/workshop/gitee/3place |grep md | grep -E "$t_today|$t_date_1" |grep "2025" >>/tmp/ot
sort /tmp/ot | grep "年" |xargs subl
sort /tmp/ot | sed -e "/年/d" |xargs subl

# 打开本地阅读文件

find ~/workshop/gitee/booksoutofcontrol |grep md | grep $t_today |sed "/年/d" >/tmp/ot
find ~/workshop/gitee/booksoutofcontrol |grep md | grep $t_today |grep "2025" >>/tmp/ot
sort /tmp/ot | grep "年" |xargs subl
sort /tmp/ot | sed -e "/年/d" |xargs subl
